// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1

Page {

    id: historiquePage
    onStatusChanged: {
        if (status ==PageStatus.Active)
            medicsmodel.setQuery("SELECT * from  COMPO WHERE dci LIKE 'r%' limit 1,10")
    }
    TopBar {
        id: topBar
        anchors.top : parent.top
        topText : "Historique"



    }


    SearchBar {
        id: rectSearchBar
    }


    BottomBar {
        id: toolBar
        anchors.bottom: parent.bottom
        favorisVisible: false
        historiqueVisible: false

        //anchors.top: listView.bottom
    }


    /*ListView {
        id: listView
        anchors.top:rectSearchBar.bottom
        anchors.bottom: toolBar.top
        width: parent.width
        clip: true
        model: favorismodel


        delegate: ListItem {
            id:item
            subItemIndicator: true


            Image  {
                width: 32
                height: 32
                source: "icon.png"
                anchors.left: parent.paddingItem.left
                anchors.verticalCenter: parent.paddingItem.verticalCenter

            }


            Column {
                anchors.left: parent.paddingItem.left
                anchors.leftMargin: 40
                anchors.verticalCenter: parent.verticalCenter
                width: parent.width
                ListItemText {
                    text:denomination
                    role: "Title"
                    font.pixelSize: 20
                    elide: Text.ElideRight
                    width: parent.width - 100
                }


                ListItemText {
                    text:forme
                    font.pixelSize: 12
                    role: "SubTitle"

                }
            }


            onClicked: {
                mainPage.pageStack.push(page2);
                mainPage.pageStack.currentPage.url ="http://afssaps-prd.afssaps.fr/php/ecodex/rcp/R"+code+".htm";

                console.debug("http://afssaps-prd.afssaps.fr/php/ecodex/rcp/R"+code+".htm");

            }

        }
    }*/

    Component {

        id:page2
        InfoPage {
            id:infoPage
            url: "http://afssaps-prd.afssaps.fr/php/ecodex/rcp/R0193580.htm"


        }

    }

    function search ()
    {
       // if(pageStatus.active != "MainPage.qml")
            pageStack.push(Qt.resolvedUrl("MainPage.qml"))


    }


}
